package com.zhanjixun.biz.service.impl;

import com.zhanjixun.api.domain.UserDTO;
import com.zhanjixun.api.service.UserService;
import com.zhanjixun.biz.dao.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author :zhanjixun
 * @date : 2018/12/17 12:38
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDAO userDAO;

    @Override
    public UserDTO queryUserById(int id) {
        return userDAO.selectById(id);
    }

    @Override
    public int insertUser(UserDTO userDTO) {
        return userDAO.insertUser(userDTO);
    }

    @Override
    public UserDTO authUser(String userName, String password) {
        return userDAO.selectByUserNameAndPassword(userName, password);
    }

}
